/**
 * author: Hanflyee  flyee1980@163.com
 * vision: v1.0
 * data: 2009-7-9
 */
package com.flyee.service{

	import com.flyee.communicate.character.EquipChangeHandler;
	import com.flyee.communicate.character.JoinRoomHandler;
	import com.flyee.communicate.character.LoginHandler;
	import com.flyee.communicate.character.MoveAvatarHandler;
	import com.flyee.communicate.character.MoveAvatarsHandler;
	import com.flyee.communicate.character.QuitRoomHandler;
	import com.flyee.communicate.character.SkillScopeHandler;
	import com.flyee.communicate.character.SkillSingleHandler;
	import com.flyee.communicate.scene.GetSceneCommunicate;
	import com.flyee.communicate.system.ExceptionHandler;
	import com.flyee.communicate.system.PingHandler;
	import com.flyee.controller.CharacterCartoonController;
	import com.flyee.controller.CharacterSkillController;
	import com.flyee.controller.CharactorMoveController;
	import com.flyee.controller.ComponentController;
	import com.flyee.controller.MonsterController;
	import com.flyee.controller.SceneController;
	import com.flyee.controller.SkillPanelController;
	import com.flyee.controller.SystemController;
	import com.flyee.utils.MyLog;
	
	/**
	 * C层，系统相关管理类,如Ping值显示
	 */
	public class ObserverRegister{
		
		//handler
		[Inject]
		public var exceptionHandler : ExceptionHandler;
		[Inject]
		public var quitRoomHandler : QuitRoomHandler;
		[Inject]
		public var moveAvatarsHandler : MoveAvatarsHandler;
		[Inject]
		public var moveAvatarHandler : MoveAvatarHandler;
		[Inject]
		public var loginHandler : LoginHandler;
		[Inject]
		public var joinRoomHandler : JoinRoomHandler;
		[Inject]
	    public var skillScopeHandler : SkillScopeHandler;
	    [Inject]
	    public var skillSingleHandler : SkillSingleHandler;
		[Inject]
		public var getSceneCommunicate : GetSceneCommunicate;
	    [Inject]
	    public var pingHandler:PingHandler;
	    [Inject]
	    public var equipChangeHandler:EquipChangeHandler;
	    
	    //service
	    [Inject]
	    public var sceneService : SceneService;
	    [Inject]
	    public var charactorService : CharactorService
	    
	    //controller
	    [Inject]
	    public var systemController:SystemController;
	    [Inject]
	    public var moveController : CharactorMoveController;
	    [Inject]
	    public var cartoonController : CharacterCartoonController;
	    [Inject]
	    public var skillController : CharacterSkillController;
	    [Inject]
	    public var sceneController : SceneController;
	    [Inject]
	    public var componentController : ComponentController;
	    [Inject]
	    public var skillPanelController : SkillPanelController;
	    [Inject]
	    public var monsterController : MonsterController;
	
	    public function ObserverRegister() {
	        MyLog.debug("init ObserverRegister");
	    }
	
	    /**注册观察者 各个CONTROLLER之间的通信*/
	    [PostConstruct]
	    public function doRegist() : void {
	        pingHandler.addObserver(systemController);
	        exceptionHandler.addObserver(systemController);
	        //handler 2 servicer
	        getSceneCommunicate.addObserver(sceneService);
	        loginHandler.addObserver(charactorService);
	        joinRoomHandler.addObserver(sceneService);
	        moveAvatarsHandler.addObserver(charactorService);
	        moveAvatarHandler.addObserver(charactorService);
	        skillScopeHandler.addObserver(charactorService);
	        skillSingleHandler.addObserver(charactorService);
	        quitRoomHandler.addObserver(charactorService);
	        equipChangeHandler.addObserver(charactorService);
	        //service 2 service
	        sceneService.addObserver(charactorService);
	        //controller 2 controller
	        moveController.addObserver(sceneController);
	        moveController.addObserver(cartoonController);
	        componentController.addObserver(sceneController);
	        sceneController.addObserver(componentController);
	        skillController.addObserver(skillPanelController);
	        skillController.addObserver(cartoonController);
	        skillController.addObserver(monsterController);
	        cartoonController.addObserver(skillPanelController);
	    }
	
	
	}

}